var importJsonCodeViewData;
var formDesignerIndex = {
    init: function () {
        var formDesignerUuid = $.getUrlParam('formDesignerUuid');
        var id = $.getUrlParam('id');
        layui.use(['formDesigner'], function () {
            var data = [];
            layui.formDesigner.render({
                data: data,
                elem: '#formdesigner'
            });
        });
        if(formDesignerUuid != undefined && formDesignerUuid != null && formDesignerUuid != ""){
            var option = kaValue.getUrl("formDesignerGetId");
                option.url = option.url + "/" + id;
                option.async = false;
                option.success = function (re) {
                    if (re.code == 200) {
                        var formDesignerData = re.data;
                        importJsonCodeViewData = formDesignerData.content
                        if(importJsonCodeViewData!=undefined && importJsonCodeViewData!=null && importJsonCodeViewData!="" && importJsonCodeViewData!="[]"){
                            setTimeout(function () {
                                $("#btnImportJson").click();
                                $("#import-json-code-view").val(importJsonCodeViewData);
                                $("#import-json-code").click();
                            }, 300);
                            
                        }
                    }
                }
                option.error = function (re) {
                    return false;
                }
                ka.ajax(option);
        }
    }
}
